package chapter11.section6;

/*程序11-4b BankApp 银行业务程序启动类*/
public class BankApp {
    public static void main(String[] args) {
        Account account = new Account("张华", 1000);
        QueueMachine queue = new QueueMachine();
        TransactionGenerator generator = new TransactionGenerator(queue, account);
        ThreadGroup group = new ThreadGroup("clerk");

        Clerk clerk1 = new Clerk(queue, "职员甲", group);
        Clerk clerk2 = new Clerk(queue, "职员乙", group);

        generator.start();
        clerk1.start();
        clerk2.start();
        Monitor monitor = new Monitor(generator, group, account);
        monitor.start();
    }
}
